# -*- coding: utf-8 -*-
# @Time     : 2021/4/18 21:25
# @Author   : pengrenjie
# @Email    : 941257162@.com
# @File     : 10.py
from collections import defaultdict
a = input("请输入一个字符串:")
chars = defaultdict(int)
for i in range(len(a)):
    if a[i] in chars:
        print(i)
        print(a[i])
        break

    else:
        chars[a[i]]+=1
